package simpleFactory;
/*
 * @auther 顶风少年
 * @mail dfsn19970313@foxmail.com
 * @date 2019-07-23 14:33
 * @notify 苹果
 * @version 1.0
 */

public class Apple implements Fruit {
    //    树的年龄
    private int treeAge;

    @Override
    public void grow() {
        log("Apple is growing...");
    }

    @Override
    public void harvest() {
        log("Apple has been harvested");
    }

    @Override
    public void plant() {
        log("Apple has been planted");
    }

    //    辅助方法
    public static void log(String msg) {
        System.out.println(msg);
    }

    //    树龄的取值方法
    public int getTreeAge() {
        return treeAge;
    }

    //设置树年龄
    public void setTreeAge(int treeAge) {
        this.treeAge = treeAge;
    }

}
